package org.mtmi.ui.controls.edits;

import org.eclipse.swt.graphics.Color;
import org.mtmi.ui.controls.Control;
import org.mtmi.ui.controls.Knob;
import org.mtmi.ui.drawables.IColorDrawable;
import org.mtmi.ui.drawables.KnobDotColorDrawable;

/**
 * Action to change Knob dot color.
 */
public class KnobDotColorAction extends AbstractChooseColorAction 
{

	@Override
	protected Color getColor( Control c ) {
		return ((Knob)c).getDotColor();
	}

	@Override
	protected void setColor( Control k, Color c ) {
		((Knob)k).setDotColor( c );
	}

	@Override
	protected boolean isControlHandled(Control c) {
		return c instanceof Knob;
	}
	
	@Override
	protected IColorDrawable createColorDrawable() {
		return new KnobDotColorDrawable( null );
	}

}
